package com.lixn.homework.plugin;

import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

@Configuration
public class PageHelperPlugin {

    /**
     * 注册分页助手插件
     * @return
     */
    @Bean
    public PageHelper register(){
        PageHelper pageHelper = new PageHelper();
        Properties properties = new Properties();
        properties.setProperty("dialect", "mysql");
        pageHelper.setProperties(properties);
        return  pageHelper;
    }

}
